package com.ruoyi.supplier.mapper;

import java.util.List;
import com.ruoyi.supplier.domain.TbPurchase;
import com.ruoyi.supplier.domain.TbPurchaseDTO;
import com.ruoyi.supplier.domain.TbPurchaseDetail;

/**
 * 采购Mapper接口
 * 
 * @author ruoyi
 * @date 2021-02-16
 */
public interface TbPurchaseMapper 
{
    /**
     * 查询采购
     * 
     * @param id 采购ID
     * @return 采购
     */
    public TbPurchase selectTbPurchaseById(Long id);

    /**
     * 查询采购列表
     * 
     * @param tbPurchase 采购
     * @return 采购集合
     */
    public List<TbPurchase> selectTbPurchaseList(TbPurchase tbPurchase);

    /**
     * 查询采购明细
     * @param tbPurchaseDTO
     * @return
     */
    List<TbPurchaseDTO> selectTbPurchaseDetailList(TbPurchaseDTO tbPurchaseDTO);

    /**
     * 新增采购
     * 
     * @param tbPurchase 采购
     * @return 结果
     */
    public int insertTbPurchase(TbPurchase tbPurchase);

    /**
     * 修改采购
     * 
     * @param tbPurchase 采购
     * @return 结果
     */
    public int updateTbPurchase(TbPurchase tbPurchase);

    /**
     * 删除采购
     * 
     * @param id 采购ID
     * @return 结果
     */
    public int deleteTbPurchaseById(Long id);

    /**
     * 批量删除采购
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTbPurchaseByIds(Long[] ids);

    /**
     * 批量删除采购明细
     * 
     * @param customerIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteTbPurchaseDetailByPurchaseIds(Long[] ids);
    
    /**
     * 批量新增采购明细
     * 
     * @param tbPurchaseDetailList 采购明细列表
     * @return 结果
     */
    public int batchTbPurchaseDetail(List<TbPurchaseDetail> tbPurchaseDetailList);
    

    /**
     * 通过采购ID删除采购明细信息
     * 
     * @param roleId 角色ID
     * @return 结果
     */
    public int deleteTbPurchaseDetailByPurchaseId(Long id);

    /**
     * 查询当前最大采购批次号
     * @return
     */
    String selectNumber();
}
